<?php
require $this->__RAD__ . 'component/global/head.php';
?>

<?php
require $this->__RAD__ . 'component/global/nav.php';
?>
	<!-- 内容 -->
	<div class="wrap">
		<div class="banner">
			<img src="<?= $this->__STATIC__ ?>images/contact/banner.jpg">
		</div>
		<div class="allTitle">
			<div class="width">
				<div class="contain clearboth">
					<div class="left">
						<div class="swiper-container titSwiper">
							<div class="swiper-wrapper">
                                <?php if ($this->product_column): ?>
                                    <?php foreach ($this->product_column as $key => $val): ?>
                                        <?php if (isset($val['id_tree']) && $val['language'] == $this->__LANGUAGE_ID__):
                                            $_tmpLink = App\Tools\UrlHelper::getTypeUrl($this->aryCategoryDataView, $val['id_tree']);
                                        endif; ?>
                                        <?php if(isset($val['category_name'])): ?>
                                            <div class="swiper-slide
                                        <?php if($key == $this->categoryId) : ?>
                                            cur
                                        <?php endif; ?> ">
                                                <a href="<?= $_tmpLink ?>">
                                                    <?= $val['category_name'] ?>
                                                </a>
                                            </div>
                                        <?php endif; ?>
                                    <?php endforeach; ?>
                                <?php endif; ?>
							</div>
						</div>
					</div>
					<div class="right">
                        <?php
                        require $this->__RAD__ . 'component/global/product_bread_crumb.php';
                        ?>
					</div>
				</div>
			</div>
		</div>
		<div class="messages">
			<div class="page1">
				<div class="width">
					<div class="contain">
						<div class="title">
							<p>
								在线留言
							</p>
						</div>
						<div class="cen clearboth">
                            <?= $this->substance ?>
							<div class="forms">
                                <form id="forms" method="post">
                                    <input type="text" placeholder="* 公司名称" class="company_name" name="company_name">
                                    <input type="text" placeholder="联络地址" class="address"  name="address">
                                    <input type="text" placeholder="* 联络人" class="people"  name="people">
                                    <input type="text" placeholder="* Email" class="mail"  name="mail">
                                    <input type="text" placeholder="* 联络电话" class="mobile"  name="mobile">
                                    <input type="text" placeholder="传真" class="fax"  name="fax">
                                    <textarea placeholder="* 内容" class="content"  name="content"></textarea>
                                </form>
							</div>
						</div>
						<div class="bot">
							<a href="javascript:;" id="form_click">
								提交
							</a>
							<span>
								“ * ” 字号字段必须填写
							</span>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>

    <!-- 右侧 -->
    <?php
    require $this->__RAD__ . 'component/global/right.php';
    ?>

    <?php
    require $this->__RAD__ . 'component/global/footer.php';
    ?>

<script>
    $(function(){
        $("#form_click").click(function(){
            var data = {};
            data['company_name']    =   $("#forms .company_name").val();
            data['address']         =   $("#forms .address").val();
            data['people']          =   $("#forms .people").val();
            data['mail']            =   $("#forms .mail").val();
            data['mobile']          =   $("#forms .mobile").val();
            data['fax']             =   $("#forms .fax").val();
            data['content']         =   $("#forms .content").val();
            var status              =   0;
            if ($.trim(data['company_name']) == "") {
                $("#forms .company_name").css('border','1px solid red');
                status  =   1;
            }
            if ($.trim(data['people']) == "") {
                $("#forms .people").css('border','1px solid red');
                status  =   1;
            }
            if ($.trim(data['mail']) == "") {
                $("#forms .mail").css('border','1px solid red');
                status  =   1;
            }
            if ($.trim(data['mobile']) == "") {
                $("#forms .mobile").css('border','1px solid red');
                status  =   1;
            }
            if ($.trim(data['content']) == "") {
                $("#forms .content").css('border','1px solid red');
                status  =   1;
            }
            if (status == 1) return;

            $.post('/App/ZhCN/AddFile', {data: data}, function (data) {
                console.log(data);
            });

        })

        $("#forms .company_name,#forms .people,#forms .mail,#forms .mobile,#forms .content ").click(function(){
            $(this).css('border','1px solid #eaeaea');
        })

    })
</script>